<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        /* 1 */
        /* .b {
            width: 200px;
            height: 200px;
            border: 2px solid gold;
        }

        .b .c {
            width: 100px;
            height: 100px;
            background-color: gray;
        } */

        /* .b .c.d {
            width: 100px;
            height: 100px;
            background-color: red;
        } */


        /* 2 */
        /* .a.b{
            color: greenyellow;
        } */


        
        /* 3 */
        .b {
            width: 200px;
            height: 200px;
            border: 2px solid gold;
        }

       
        .b .c {
            width: 100px;
            height: 100px;
            background-color: red;
        } 

        .b .c,.d  {
            width: 100px;
            height: 100px;
            background-color: gray;
        } 

    </style>
</head>

<body>

    <!-- 1 -->
    <!-- <div class="b">
        <div class="c d"></div>
    </div> -->


    <!-- 2 -->
    <!-- color font有继承性，如果父亲有那个颜色，那么下面的就都有 -->
    <!-- <div class="a b">111111
        <div class="b">222222222
            <div class="a">3333333</div>
        </div>
    </div> -->


    <!-- 3 -->
    <div class="b">
        <div class="c d"></div>
    </div>



</body>

</html>